//
//  UILabel+Extension.swift
//  微博
//
//  Created by 刘保满 on 16/5/24.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

extension UILabel {
    
    
    convenience init(title: String, font: CGFloat, textColor: UIColor, alignmet: NSTextAlignment = .Center ) {
        
        self.init()
    
        self.text = title
        self.font = UIFont.systemFontOfSize(font)
        
        self.textAlignment = alignmet
        
        if alignmet == .Left {
            //设置最大布局宽度
            preferredMaxLayoutWidth = ScreenWidth - 2 * StatusCellMargin
        }
        self.textColor = textColor
        
        self.numberOfLines = 0
     
        sizeToFit()
  
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}